package com.cx330;

public class Example81_01 {
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> System.out.println("Thread 1 is running"));
        Thread t2 = new Thread(() -> {
            try {
                t1.join(); // 等待t1执行完毕
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("Thread 2 id running");
        });
        Thread t3 = new Thread(() -> {
            try {
                t2.join(); // 等待t2执行完毕
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("Thread 3 is running");
        });
        t1.start();
        t2.start();
        t3.start();
    }
}
